<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Title</title>
    
    <style>
      .card {
        border: 1px gray solid;
        border-radius: 10px;
        padding: 15px;
      }
      
      .card-title {
        font-size: 15px;
        font-weight: bold;
        margin: 10px;
      }
      
      .card-body > div {
        color: darkgray;
        background: pink;
        margin: 10px;
        padding: 10px 20px;
      }
      
      .card-body {
        display: grid;
        grid-template-columns: repeat(3, auto);
        grid-template-rows: repeat(2, auto);
        height: 300px;
      }
    </style>
  </head>
  <body style="display: grid;grid-template-columns: repeat(4,1fr);gap: 10px">
    <!--place-content属性用于设置所有网格项组成的整个内容区在容器中的水平位置和垂直位置，该属性是justity-content和align-content的结合体，其属性值为开始位置start、结束位置end、中间位置center、拉伸占满stretch、内容区两侧有间隔且比单元格间隔小一倍space-around、内容区两侧无间隔且各个单元格间隔相等space-between、内容区两侧有间隔且与单元格间隔相等space-evenly-->
    <div class="card">
      <div class="card-title">开始位置start</div>
      <div class="card-body" style="place-content: start start">
        <div>1</div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
        <div>5</div>
        <div>6</div>
      </div>
    </div>
    
    <div class="card">
      <div class="card-title">结束位置end</div>
      <div class="card-body" style="place-content: end end">
        <div>1</div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
        <div>5</div>
        <div>6</div>
      </div>
    </div>
    
    <div class="card">
      <div class="card-title">中间位置center</div>
      <div class="card-body" style="place-content: center center">
        <div>1</div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
        <div>5</div>
        <div>6</div>
      </div>
    </div>
    
    <div class="card">
      <div class="card-title">拉伸占满stretch</div>
      <div class="card-body" style="place-content: stretch stretch">
        <div>1</div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
        <div>5</div>
        <div>6</div>
      </div>
    </div>
    
    <div class="card">
      <div class="card-title">内容区两侧有间隔且比单元格间隔小一倍space-around</div>
      <div class="card-body" style="place-content: space-around space-around">
        <div>1</div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
        <div>5</div>
        <div>6</div>
      </div>
    </div>
    
    <div class="card">
      <div class="card-title">内容区两侧无间隔且各个单元格间隔相等space-between</div>
      <div class="card-body" style="place-content: space-between space-between">
        <div>1</div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
        <div>5</div>
        <div>6</div>
      </div>
    </div>
    
    <div class="card">
      <div class="card-title">内容区两侧有间隔且与单元格间隔相等space-evenly</div>
      <div class="card-body" style="place-content: space-evenly space-evenly">
        <div>1</div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
        <div>5</div>
        <div>6</div>
      </div>
    </div>
  </body>
</html>